package com.knight.tomcat.common;

public abstract class AbstractServlet {


    public void service(KnightRequest request, KnightResponse response) {
        String method = request.getMethod();
        if (method.toUpperCase().equals("POST")) {
            doPost(request, response);
        } else {
            doGet(request, response);
        }
    }


    protected abstract void doPost(KnightRequest request, KnightResponse response);


    protected abstract void doGet(KnightRequest request, KnightResponse response);

}
